/**
 * Created by Administrator on 2016/4/8.
 */
import java.util.Scanner;
public class Sushu {
    public static void main(String[] args){
        int i,n,k=1,N=100;
        System.out.print(2+"\t");
        for (n=3;n<=N;n++){
            i=2;
            while(i<n){
                if (n%i==0)
                    break;
                i++;
            }
            if (i==n){
                k++;
                System.out.print(i+"\t");
                if (k%6==0)
                    System.out.println();
            }
        }
    }
}
